While...Do

General Control Statement

Syntax samples

WHILE <Boolean expression> DO <statement block>

WHILE Array1[n] <> 10 DO INC n

WHILE FREECAP(Loc1) > 5 DO
BEGIN
INC Var2, 5
WAIT 5 sec
END

Description

Repeats a statement or statement block continuously while a condition remains true. WHILE...DO is an entry-condition loop, meaning that the loop will not be executed once unless the Boolean expression is true.

Valid In

Any logic.

Components

<Boolean expression>

As long as this expression is TRUE, the loop will continue. This expression is evaluated for each iteration of the loop.

<statement block>

The statement or block of statements to execute.

Example

The example below shows the arrival logic window for an entity that arrives every 40 hours to reset the values of Array1 elements 1 through 100 to 0.

 

 

See Also

BEGIN, END, DO...WHILE, and DO...UNTIL.